using Holoville.HOTween;
using I2.Loc;
using UnityEngine;

public class MarketExportSkinButton : MonoBehaviour
{
	public UIWidget holder;

	public UISprite buttonSprite;

	public UILabel title;

	private void OnClick()
	{
		Debug.Log("Export Skin " + MarketControllerUI.instance.selectedProduct.id);
		MarketController.Instance.ExportSkin((ProductSkin)MarketControllerUI.instance.selectedProduct);
	}

	private void OnEnable()
	{
		holder.alpha = 0f;
		HOTween.To(holder, 0.25f, new TweenParms().Prop("alpha", 1f).UpdateType(UpdateType.TimeScaleIndependentUpdate));
	}

	public void SetButton()
	{
		if (MarketControllerUI.instance.selectedProduct is ProductSkin)
		{
			holder.gameObject.SetActive(true);
			string text = ScriptLocalization.Get("Market/marketExport");
			if (title != null)
			{
				title.text = ((!string.IsNullOrEmpty(text)) ? text : "Нет локализации");
			}
		}
		else
		{
			holder.gameObject.SetActive(false);
		}
	}
}
